package com.bdqn.repository;

import com.bdqn.pojo.Role;
import com.bdqn.vo.UserInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

/**
 * RoleRepository 类
 *
 * @author 玲玲
 * @Since 2023-11-27
 */
public interface RoleRepository extends JpaRepository<Role,Long> {
    @Query("select u.usrId as usrId,u.usrName as usrName,u.usrPassword as usrPasswrd, u.role.roleId as usrRoleId,u.usrFlag as usrFlag,r.roleName from  User u,Role r where u.role.roleId=r.roleId and u.usrId=?1")
    public UserInfo getUserInfo(Long usrId);

}
